package com.glut.campusrepair.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glut.campusrepair.entity.RepairTasks1;
import com.glut.campusrepair.mapper.RepairTasks1Mapper;
import com.glut.campusrepair.service.IRepairTasks1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 维修进度表 服务实现类
 *
 * @author sanminzhi
 * @since 2024-07-22 13:59
 */
@Service
public class RepairTasks1ServiceImpl extends ServiceImpl<RepairTasks1Mapper, RepairTasks1> implements IRepairTasks1Service {

    @Autowired
    private RepairTasks1Mapper repairTasks1Mapper;

    @Override
    public boolean existsByFailureRepairId(int failureRepairId) {
        return repairTasks1Mapper.countByFailureRepairId(failureRepairId) > 0;
    }


    @Override
    public List<RepairTasks1> list() {
        // 调用 Mapper 的方法来获取任务列表
        return repairTasks1Mapper.selectList(null); // 这里你可以根据实际需求修改查询条件
    }

}
